<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>DSF2FLAC: dsfFileReader Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">DSF2FLAC
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-static-methods">Static Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">dsfFileReader Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="dsfFileReader" --><!-- doxytag: inherits="DsdSampleReader" -->
<p>This class extends dsdSampleReader providing acces to dsd samples and other info from dsf files.  
 <a href="classdsfFileReader.html#details">More...</a></p>

<p><code>#include &lt;dsf_file_reader.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for dsfFileReader:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classdsfFileReader.png" usemap="#dsfFileReader_map" alt=""/>
  <map id="dsfFileReader_map" name="dsfFileReader_map">
<area href="classDsdSampleReader.html" title="Abstract class defining anything which reads dsd samples from something." alt="DsdSampleReader" shape="rect" coords="0,0,116,24"/>
</map>
 </div></div>

<p><a href="classdsfFileReader-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a902df0a055ccd5e624b1ec464d445dbc">dsfFileReader</a> (char *filePath)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Class constructor.  <a href="#a902df0a055ccd5e624b1ec464d445dbc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a5535aee76683a2a7a9bfa8af1d75e1c9">~dsfFileReader</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Class destructor.  <a href="#a5535aee76683a2a7a9bfa8af1d75e1c9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a43b5452138d47e4d17e49d23f0603410">step</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Step the reader forward by 8 DSD samples.  <a href="#a43b5452138d47e4d17e49d23f0603410"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#af32d835cbb5cca4420a002519ab4ef59">rewind</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the reader position back to the start of the DSD data.  <a href="#af32d835cbb5cca4420a002519ab4ef59"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab903d8883913dcab2c32610ee0b1c1c2"></a><!-- doxytag: member="dsfFileReader::getLength" ref="ab903d8883913dcab2c32610ee0b1c1c2" args="()" -->
dsf2flac_int64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#ab903d8883913dcab2c32610ee0b1c1c2">getLength</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the total number of DSD samples in the reader. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac715b37991a3d9a8143e99d4b6ecd3e7"></a><!-- doxytag: member="dsfFileReader::getNumChannels" ref="ac715b37991a3d9a8143e99d4b6ecd3e7" args="()" -->
dsf2flac_uint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#ac715b37991a3d9a8143e99d4b6ecd3e7">getNumChannels</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of channels in the reader. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aabb15702e6e452f492b2c1e5fc1d170f"></a><!-- doxytag: member="dsfFileReader::getSamplingFreq" ref="aabb15702e6e452f492b2c1e5fc1d170f" args="()" -->
dsf2flac_uint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#aabb15702e6e452f492b2c1e5fc1d170f">getSamplingFreq</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the DSD sampling rate of this reader (Hz). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a69546c0ae6cb4c3dcf6ff6174d72bdd6"></a><!-- doxytag: member="dsfFileReader::msbIsPlayedFirst" ref="a69546c0ae6cb4c3dcf6ff6174d72bdd6" args="()" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a69546c0ae6cb4c3dcf6ff6174d72bdd6">msbIsPlayedFirst</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Describes the order that the samples are packed into the int8 buffer entries. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae1abec9e1642eae73a97638195dd68cd"></a><!-- doxytag: member="dsfFileReader::samplesAvailable" ref="ae1abec9e1642eae73a97638195dd68cd" args="()" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#ae1abec9e1642eae73a97638195dd68cd">samplesAvailable</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns false if there are no more samples left in the reader. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6386225663a73402e361e9aed24fa9cc"></a><!-- doxytag: member="dsfFileReader::getID3Tag" ref="a6386225663a73402e361e9aed24fa9cc" args="(dsf2flac_uint32 trackNum)" -->
ID3_Tag&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a6386225663a73402e361e9aed24fa9cc">getID3Tag</a> (dsf2flac_uint32 trackNum)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the ID3 tag corresponding to the provided track number. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9681d9d5e83681a41bf6eaa93dbcda94"></a><!-- doxytag: member="dsfFileReader::dispFileInfo" ref="a9681d9d5e83681a41bf6eaa93dbcda94" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a9681d9d5e83681a41bf6eaa93dbcda94">dispFileInfo</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Can be called to display some useful info to stdout. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ace1600de9127b27c083bb624c7dd1d5f"></a><!-- doxytag: member="dsfFileReader::allocateBlockBuffer" ref="ace1600de9127b27c083bb624c7dd1d5f" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#ace1600de9127b27c083bb624c7dd1d5f">allocateBlockBuffer</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates the block buffer which holds the dsd data read from the file for when it is required by the circular buffer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa65162e687d7a02ef1afb2e58f4dfd2c"></a><!-- doxytag: member="dsfFileReader::readHeaders" ref="aa65162e687d7a02ef1afb2e58f4dfd2c" args="()" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#aa65162e687d7a02ef1afb2e58f4dfd2c">readHeaders</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads lots of info from the file. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af7853fcee213d4fc29b6369b7d9aa86c"></a><!-- doxytag: member="dsfFileReader::readMetadata" ref="af7853fcee213d4fc29b6369b7d9aa86c" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#af7853fcee213d4fc29b6369b7d9aa86c">readMetadata</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to read the metadata from the end of the dsf file. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a46a0d727a7e7c1e993205c84f57ce64c"></a><!-- doxytag: member="dsfFileReader::readNextBlock" ref="a46a0d727a7e7c1e993205c84f57ce64c" args="()" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a46a0d727a7e7c1e993205c84f57ce64c">readNextBlock</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This private function is called whenever new data from the file is needed for the block buffer. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-static-methods"></a>
Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5b5e302918ef107d00656f6247ffde58"></a><!-- doxytag: member="dsfFileReader::checkIdent" ref="a5b5e302918ef107d00656f6247ffde58" args="(dsf2flac_int8 *a, dsf2flac_int8 *b)" -->
static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsfFileReader.html#a5b5e302918ef107d00656f6247ffde58">checkIdent</a> (dsf2flac_int8 *a, dsf2flac_int8 *b)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A handy little helper for checking idents. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class extends dsdSampleReader providing acces to dsd samples and other info from dsf files. </p>
<p>Some of the rarer features of dsf are not well tested due to a lack of files: 8bit dsd </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a902df0a055ccd5e624b1ec464d445dbc"></a><!-- doxytag: member="dsfFileReader::dsfFileReader" ref="a902df0a055ccd5e624b1ec464d445dbc" args="(char *filePath)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classdsfFileReader.html#a902df0a055ccd5e624b1ec464d445dbc">dsfFileReader::dsfFileReader</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>filePath</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Class constructor. </p>
<p>filePath must be a valid dsf file location. If there is an issue reading or loading the file then <a class="el" href="classDsdSampleReader.html#af38ca8dd15acd893825877655eaff344" title="Return false if the reader is invalid (format/file error for example).">isValid()</a> will be false. </p>

</div>
</div>
<a class="anchor" id="a5535aee76683a2a7a9bfa8af1d75e1c9"></a><!-- doxytag: member="dsfFileReader::~dsfFileReader" ref="a5535aee76683a2a7a9bfa8af1d75e1c9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classdsfFileReader.html#a5535aee76683a2a7a9bfa8af1d75e1c9">dsfFileReader::~dsfFileReader</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Class destructor. </p>
<p>Closes the file and frees the internal buffers. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="af32d835cbb5cca4420a002519ab4ef59"></a><!-- doxytag: member="dsfFileReader::rewind" ref="af32d835cbb5cca4420a002519ab4ef59" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classdsfFileReader.html#af32d835cbb5cca4420a002519ab4ef59">dsfFileReader::rewind</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the reader position back to the start of the DSD data. </p>
<p>Note that child classes implementing this method must call <a class="el" href="classDsdSampleReader.html#a4985ec156a185ee79da43eaceb5f78f7" title="Clear the buffers and fill with idleSample.">clearBuffer()</a>; </p>

<p>Reimplemented from <a class="el" href="classDsdSampleReader.html#aa2545441bf8c641525cb3f2f14349d49">DsdSampleReader</a>.</p>

</div>
</div>
<a class="anchor" id="a43b5452138d47e4d17e49d23f0603410"></a><!-- doxytag: member="dsfFileReader::step" ref="a43b5452138d47e4d17e49d23f0603410" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classdsfFileReader.html#a43b5452138d47e4d17e49d23f0603410">dsfFileReader::step</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Step the reader forward by 8 DSD samples. </p>
<p>This causes the next 8 DSD samples to be added into the front of the circular buffers (one uint8). </p>

<p>Reimplemented from <a class="el" href="classDsdSampleReader.html#ab09a298f00c83340ac156e0041ee1838">DsdSampleReader</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>dsf_file_reader.h</li>
<li>dsf_file_reader.cpp</li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Sep 18 2013 23:40:43 for DSF2FLAC by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
